package com.chenfan.ccp.plug.log;//package com.chenfan.ccp.plug.log;
//
//import org.apache.logging.log4j.core.Filter;
//import org.apache.logging.log4j.core.Layout;
//import org.apache.logging.log4j.core.LogEvent;
//import org.apache.logging.log4j.core.appender.AbstractAppender;
//import org.apache.logging.log4j.core.config.plugins.Plugin;
//
//import java.io.Serializable;
//import java.util.Map;
//
//@Plugin(name = "RootAppender", category = "Core", elementType = "appender", printObject = true)
//public class RootLog4j2LogAppender extends AbstractAppender {
//
//
//    public static Map<String, AbstractLog> strategyMap;
//
//    protected RootLog4j2LogAppender(String name, Filter filter, Layout<? extends Serializable> layout) {
//        super(name, filter, layout);
//    }
//
//
//    public static Map<String, AbstractLog> getStrategyMap() {
//        if (strategyMap.isEmpty()) {
//            strategyMap = RootLogBackLogAppender.getStrategyMap();
//        }
//
//        return strategyMap;
//    }
//
//
//    @Override
//    public void append(LogEvent logEvent) {
//        //默认没启动时候控制台输出
//        if (getStrategyMap().isEmpty()) {
//            return;
//        }
//        getStrategyMap().get(logEvent.getLevel().toString()).log(logEvent.getLoggerName(), logEvent.getMessage().getFormat(), logEvent.getMessage().getParameters());
//
//
//    }
//
//}
